package model;

import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import util.JsonUtil;

import java.io.Serializable;

/**
 * pojo基础类
 *
 * @author: Anc
 * @date: 2022/07/01
 */
@JsonPropertyOrder(alphabetic = true)
public class BaseObject implements Serializable {

    private static final long serialVersionUID = -1076133440240555304L;

    @Override
    public boolean equals(Object obj) {
        return EqualsBuilder.reflectionEquals(this, obj);
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this);
    }

    @Override
    public String toString() {
        return JsonUtil.toJSon(this);
    }
}
